package kr.co.graviti.common.util;

public class CommonPrSearchUtil {
	
	/** ㄱ,ㄴ .. a,b 1,2,3 자음검색 
	 * @param str
	 * @return
	 */
	public static String prSearchNm(String str){
		
		String result;
		if(str.equals("a1")){
			result = " and cd_nm >= '가' and cd_nm <= '나'";
		}else if(str.equals("a2")){
			result = " and cd_nm >= '나' and cd_nm <= '다'";
		}else if(str.equals("a3")){
			result = " and cd_nm >= '다' and cd_nm <= '라'";
		}else if(str.equals("a4")){
			result = " and cd_nm >= '라' and cd_nm <= '마'";
		}else if(str.equals("a5")){
			result = " and cd_nm >= '마' and cd_nm <= '바'";
		}else if(str.equals("a6")){
			result = " and cd_nm >= '바' and cd_nm <= '사'";
		}else if(str.equals("a7")){
			result = " and cd_nm >= '사' and cd_nm <= '아'";
		}else if(str.equals("a8")){
			result = " and cd_nm >= '아' and cd_nm <= '자'";
		}else if(str.equals("a9")){
			result = " and cd_nm >= '자' and cd_nm <= '차'";
		}else if(str.equals("a10")){
			result = " and cd_nm >= '차' and cd_nm <= '카'";
		}else if(str.equals("a11")){
			result = " and cd_nm >= '카' and cd_nm <= '타'";
		}else if(str.equals("a12")){
			result = " and cd_nm >= '타' and cd_nm <= '파'";
		}else if(str.equals("a13")){
			result = " and cd_nm >= '파' and cd_nm <= '하'";
		}else if(str.equals("a14")){
			result = " and cd_nm >= '하' and cd_nm <= '히'";			
		}else if(str.equals("b1")){
			result = " and cd_nm >= 'a' and cd_nm <= 'b'";
		}else if(str.equals("b2")){
			result = " and cd_nm >= 'b' and cd_nm <= 'c'";
		}else if(str.equals("b3")){
			result = " and cd_nm >= 'c' and cd_nm <= 'd'";
		}else if(str.equals("b4")){
			result = " and cd_nm >= 'd' and cd_nm <= 'e'";
		}else if(str.equals("b5")){
			result = " and cd_nm >= 'e' and cd_nm <= 'f'";
		}else if(str.equals("b6")){
			result = " and cd_nm >= 'f' and cd_nm <= 'g'";
		}else if(str.equals("b7")){
			result = " and cd_nm >= 'g' and cd_nm <= 'h'";
		}else if(str.equals("b8")){
			result = " and cd_nm >= 'h' and cd_nm <= 'i'";
		}else if(str.equals("b9")){
			result = " and cd_nm >= 'i' and cd_nm <= 'j'";
		}else if(str.equals("b10")){
			result = " and cd_nm >= 'j' and cd_nm <= 'k'";
		}else if(str.equals("b11")){
			result = " and cd_nm >= 'k' and cd_nm <= 'l'";
		}else if(str.equals("b12")){
			result = " and cd_nm >= 'l' and cd_nm <= 'm'";
		}else if(str.equals("b13")){
			result = " and cd_nm >= 'm' and cd_nm <= 'n'";
		}else if(str.equals("b14")){
			result = " and cd_nm >= 'n' and cd_nm <= 'o'";
		}else if(str.equals("b15")){
			result = " and cd_nm >= 'o' and cd_nm <= 'p'";
		}else if(str.equals("b16")){
			result = " and cd_nm >= 'p' and cd_nm <= 'q'";
		}else if(str.equals("b17")){
			result = " and cd_nm >= 'q' and cd_nm <= 'r'";
		}else if(str.equals("b18")){
			result = " and cd_nm >= 'r' and cd_nm <= 's'";
		}else if(str.equals("b19")){
			result = " and cd_nm >= 's' and cd_nm <= 't'";
		}else if(str.equals("b20")){
			result = " and cd_nm >= 't' and cd_nm <= 'u'";
		}else if(str.equals("b21")){
			result = " and cd_nm >= 'u' and cd_nm <= 'v'";
		}else if(str.equals("b22")){
			result = " and cd_nm >= 'v' and cd_nm <= 'w'";
		}else if(str.equals("b23")){
			result = " and cd_nm >= 'w' and cd_nm <= 'x'";
		}else if(str.equals("b24")){
			result = " and cd_nm >= 'x' and cd_nm <= 'y'";
		}else if(str.equals("b25")){
			result = " and cd_nm >= 'y' and cd_nm <= 'z'";
		}else if(str.equals("b26")){
			result = " and cd_nm >= 'z'";
		}else if(str.equals("c1")){
			result = " and cd_nm >= '1' and cd_nm <= '2'";
		}else if(str.equals("c2")){
			result = " and cd_nm >= '2' and cd_nm <= '3'";
		}else if(str.equals("c3")){
			result = " and cd_nm >= '3' and cd_nm <= '4'";
		}else if(str.equals("c4")){
			result = " and cd_nm >= '4' and cd_nm <= '5'";
		}else if(str.equals("c5")){
			result = " and cd_nm >= '5' and cd_nm <= '6'";
		}else if(str.equals("c6")){
			result = " and cd_nm >= '6' and cd_nm <= '7'";
		}else if(str.equals("c7")){
			result = " and cd_nm >= '7' and cd_nm <= '8'";
		}else if(str.equals("c8")){
			result = " and cd_nm >= '8' and cd_nm <= '9'";
		}else if(str.equals("c9")){
			result = " and cd_nm >= '9' and cd_nm <= '0'";
		}else{
			result = "";
		}
		
		return result;
	}
}
